package com.eagletsoft.mmproj.ui;

import java.util.ArrayList;
import java.util.List;

import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.view.ViewPager;

import com.eagletsoft.mmproj.R;
import com.eagletsoft.mmproj.model.MessageModel;

public class HomeActivity extends BaseActivity {
	
	public final static Integer[] TEST_IMAGE_RES_IDS = new Integer[] { R.drawable.image_1,
		R.drawable.image_2, R.drawable.image_3,R.drawable.image_4,R.drawable.image_5,R.drawable.image_6,
		R.drawable.image_7,R.drawable.image_8,R.drawable.image_9,R.drawable.image_10,R.drawable.image_11,
		R.drawable.image_12,R.drawable.image_13,R.drawable.image_14,R.drawable.image_15,R.drawable.image_16,
		R.drawable.image_17,R.drawable.image_18};
	
	private ViewPager mViewPager; 
	private MyPageAdapter mPageAdapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_home);
		
		setupViews(); 
	}
	
	private void setupViews(){ 
		List<MessageModel> data = new ArrayList<MessageModel>();
		for (int i = 0; i < 18; i++) {
			MessageModel message = new MessageModel();
			message.messageTitle = "Test" + i;
			message.messageImage = TEST_IMAGE_RES_IDS[i];
			data.add(message);
		}
		
		mViewPager = (ViewPager)findViewById(R.id.viewpager);
		mPageAdapter = new MyPageAdapter(this, data);
		mViewPager.setAdapter(mPageAdapter); 
	}
}
